<template>
	<view>
		<home v-if="PageCur=='home'"></home>
		<mine v-if="PageCur=='mine'"></mine>
		<school v-if="PageCur=='school'"></school>
		<view class="cu-bar tabbar bg-white shadow foot">
			<view class="action" @click="handleNavChange" data-cur="home">
				<view class='cuIcon-cu-image'>
					<image :src="'/static/tabbar/home' + [PageCur=='home'?'_cur':''] + '.png'"></image>
				</view>
				<view :class="PageCur=='home'?'text-blue':'text-gray'">首页</view>
			</view>
			<view class="action" @click="handleNavChange" data-cur="school">
				<view class='cuIcon-cu-image'>
					<image :src="'/static/tabbar/school' + [PageCur == 'school'?'_cur':''] + '.png'"></image>
				</view>
				<view :class="PageCur=='school'?'text-blue':'text-gray'">校园服务</view>
			</view>
			<view class="action" @click="handleNavChange" data-cur="mine">
				<view class='cuIcon-cu-image'>
					<image :src="'/static/tabbar/mine' + [PageCur == 'mine'?'_cur':''] + '.png'"></image>
				</view>
				<view :class="PageCur=='mine'?'text-blue':'text-gray'">我的</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'Hell1o',
				PageCur: 'home'
			}
		},
		onLoad() {
			this.$a.api.hello().then(data => {
				console.log(data);
			});

		},
		methods: {
			handleNavChange: function(e) {
				this.PageCur = e.currentTarget.dataset.cur
			}
		}
	}
</script>

<style>

</style>
